Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose shape fields #272

Merged
merged 5 commits into from
Jan 26, 2025
Merged

Conversation

carrascomj
Copy link
Contributor

Description

Making the Shape fields public allows for surgical modifications without requiring to rebuild the Path when only changes to the color or the options of some field are desired.

Implementation

  • Made all Shape attributes public.
  • Added an example of changing the fill and stroke without rebuilding the path.

This works since src/plugins.rs:mesh_shapes_system is triggered by changes in the fields of a Shape.

@carrascomj carrascomj force-pushed the enhance-expose-shape-fields branch from 17c7ab2 to 8e13f53 Compare December 30, 2024 16:47
@carrascomj
Copy link
Contributor Author

Probably the getter methods of Shape should now be removed (?).

Copy link
Owner

@Nilirad Nilirad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is correct: paths are quite expensive to calculate. I left some corrections suggested. You can also remove the getter methods of Shape since the fields are now public. For the rest, it looks good.

src/entity.rs Show resolved Hide resolved
examples/dynamic_stroke_size.rs Outdated Show resolved Hide resolved
examples/dynamic_stroke_size.rs Outdated Show resolved Hide resolved
examples/dynamic_stroke_size.rs Outdated Show resolved Hide resolved
@carrascomj
Copy link
Contributor Author

Great! I think that should be it, then.

@carrascomj carrascomj requested a review from Nilirad January 26, 2025 13:39
@Nilirad Nilirad merged commit f5a3610 into Nilirad:master Jan 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants